<?php

include 'config.php';
include 'common.php';



if(isset($_COOKIE['token'])) {
    // 获取用户信息.
    $uid = $_COOKIE['uid'];
    $token = $_COOKIE['token'];
    $post = array(
        "uid" => $uid,
        "token" => $token
    );
    // 获取用户金币.
    $result = curlRequest($config['getCoinApi'],true,$post);
    $result = json_decode($result,true);
    $coinbalance = $result['data'];
    setcookie("coinbalance",$coinbalance, time() + 3600*24*30 );
    header("Location: https://m.mxzhuawawa.com/personal.html");
} else {
    header("Location: https://m.mxzhuawawa.com/login.html");
}

